#region Copyright

//  Weapsy - http://www.weapsy.org
//  Copyright (c) 2011-2012 Luca Cammarata Briguglia
//  Licensed under the Weapsy Public License Version 1.0 (WPL-1.0)
//  A copy of this license may be found at http://www.weapsy.org/Documentation/License.txt

#endregion

using System;
using System.Collections.Generic;
using System.Web.Caching;

namespace Infrastructure.Crosscutting.Caches
{
    public interface ICacheService
    {
        /// <summary>
        /// Inserts the specified key.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="obj">The obj.</param>
        /// <param name="timeOut">The time out.</param>
        /// <param name="priority">The priority.</param>
        void Insert(string key, object obj, double timeOut, CacheItemPriority priority);

        /// <summary>
        /// Inserts the specified key.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="obj">The obj.</param>
        /// <param name="dependency">The dependency.</param>
        /// <param name="timeOut">The time out.</param>
        /// <param name="slidingExpiration">The sliding expiration.</param>
        /// <param name="priority">The priority.</param>
        /// <param name="removedCallback">The removed callback.</param>
        void Insert(string key, object obj, CacheDependency dependency, double timeOut, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback removedCallback);

        /// <summary>
        /// Gets the specified key.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <returns></returns>
        object Get(string key);

        /// <summary>
        /// Removes the specified key.
        /// </summary>
        /// <param name="key">The key.</param>
        void Remove(string key);

        /// <summary>
        /// Removes the by pattern.
        /// </summary>
        /// <param name="pattern">The pattern.</param>
        void RemoveByPattern(string pattern);

        /// <summary>
        /// Clears this instance.
        /// </summary>
        void Clear();

        /// <summary>
        /// Caches the item priorities.
        /// </summary>
        /// <returns></returns>
        Dictionary<byte, string> CacheItemPriorities();
    }

}